import { Component, OnInit } from '@angular/core';

import { TipsModalService } from '@core/base';
import { NzMessageService } from 'ng-zorro-antd/message';

@Component({
  selector: 'app-tips',
  templateUrl: './tips.component.html',
  styleUrls: ['./tips.component.less']
})
export class TipsComponent implements OnInit {
  constructor(private infoModalSrc: TipsModalService, private messageSrc: NzMessageService) {}
  ngOnInit(): void {}

  info(): void {
    this.infoModalSrc.info('<b>这是描述信息(粗体)</b>').subscribe(() => this.messageSrc.info('窗口关闭'));
  }

  success(): void {
    this.infoModalSrc
      .success('<b style="color: green;">这是成功信息(粗体,绿色)</b>')
      .subscribe(() => this.messageSrc.success('窗口关闭'));
  }

  fail(): void {
    this.infoModalSrc.fail('这是失败信息').subscribe(() => this.messageSrc.success('窗口关闭'));
  }

  warning(): void {
    this.infoModalSrc.warning('这是警告信息').subscribe(() => this.messageSrc.success('窗口关闭'));
  }
}
